/*
 * @Author: 清香白莲 1243327527@qq.com
 * @Date: 2023-09-06 11:06:24
 * @LastEditors: 清香白莲 1243327527@qq.com
 * @LastEditTime: 2023-09-07 14:28:30
 * @FilePath: /shang_study/src/store/home.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import {reqGetBannerList, reqGetFloorList} from '@/api';

export default {
    namespaced: true,
    actions: {
        async getBannerList(content, value) {
            let result = await reqGetBannerList();
            if (result.code == 200) {
                content.commit('GETBANNERLIST', result.data);
            }else {
                content.commit('GETBANNERLIST', []);
            }
        },
        async getFloorList(content, value) {
            let result = await reqGetFloorList();
            if (result.code == 200) {
                content.commit('GETFLOORLIST', result.data);
            }else {
                content.commit('GETFLOORLIST', []);
            }
        },
    },
    mutations: {
        GETBANNERLIST(state, bannerList) {
            state.bannerList = bannerList;
        },
        GETFLOORLIST(state, floorList) {
            state.floorList = floorList;
        }
    },
    state: {
        bannerList: [],
        floorList: [],
    },
    getters: {

    },
}